{% load i18n vueAdmin_sets %}

<fieldset>
  {% if fieldset.name %}
    <a-divider orientation="left" dashed>{{ fieldset.name }}</a-divider>
  {% endif %}
  {% if fieldset.description %}
    <a-form-item v-bind="formItemLayout" label="{% trans "description" %}" >
      <span class="ant-form-text">
        {{ fieldset.description|safe }}
      </span>
    </a-form-item>
  {% endif %}
  {% for line in fieldset %}
    <div>
      {% if line.fields|length_is:'1' and line.errors %}
        <a-alert type="error" banner>
          <div id="error-messages" slot="message">{{ line.errors|safe }}</div>
        </a-alert>
      {% endif %}
      {% for field in line %}
        <a-form-item label="" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
{#          {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}#}
        {{ field.label_tag|safe }}
          {% if field.is_checkbox %}
            {{ field.field }}
          {% else %}
            {% if field.is_readonly %}
              {{ field.contents }}
            {% else %}
              {{ field.field }}
            {% endif %}
          {% endif %}
          {% if field.field.help_text %}
            <div class="help">{{ field.field.help_text|safe }}</div>
          {% endif %}
        </a-form-item>
      {% endfor %}
    </div>
  {% endfor %}
</fieldset>
